// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import API from './API'

// ============================== 导出异步调用 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  async remoteOne({ state: { one } }) {
    const password = await CORE.rsa(one.password)
    const { token } = await API.login({ ...one, password })
    sessionStorage.TOKEN = token
  },

  // —————————————————————————————— 信息 —————————————————————————————— //

  async remoteInfo({ state: { one } }) {
    const msg = await API.send(one)
    return [{ second: 60 }, msg]
  },
}
